/*
 * PlayerGui.java
 *
 * Created on 16 maggio 2008, 0.32
 */

import javax.swing.JFrame;

/**
 *
 * @author  udelledo
 */
public class PlayerGui extends javax.swing.JPanel {
    
    /** Creates new form PlayerGui */
    public PlayerGui() {
        initComponents();
    }
    
    public PlayerGui(String name) {
        initComponents();
        this.name.setText(name);
    }
    
    public PlayerGui(String name,int gpoint, int mpoint) {
        initComponents();
        this.name.setText(name);
        this.gameScore.setText(Integer.toString(gpoint));
        this.matchScore.setText(Integer.toString(mpoint));
    }
    
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        name = new java.awt.Label();
        gameScore = new java.awt.Label();
        matchScore = new java.awt.Label();
        jolly = new javax.swing.JButton();

        setBackground(new java.awt.Color(255, 0, 0));
        setMaximumSize(new java.awt.Dimension(100, 200));
        setPreferredSize(new java.awt.Dimension(100, 200));
        name.setName("name");
        name.setText("Nome Giocatore");
        name.getAccessibleContext().setAccessibleName("name");

        gameScore.setText("Punteggio Partita");
        gameScore.getAccessibleContext().setAccessibleName("gameScore");

        matchScore.setText("Punteggio Manche");
        matchScore.getAccessibleContext().setAccessibleName("matchScore");

        jolly.setText("jButton1");

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(name, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 108, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(gameScore, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 108, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(matchScore, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(jolly, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 108, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(name, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 200, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
            .add(gameScore, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 200, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
            .add(matchScore, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 200, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
            .add(jolly, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 200, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
        );
    }// </editor-fold>//GEN-END:initComponents
        
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private java.awt.Label gameScore;
    private javax.swing.JButton jolly;
    private java.awt.Label matchScore;
    private java.awt.Label name;
    // End of variables declaration//GEN-END:variables
    
    public void setName (String name){
        this.name.setText(name);
    }
    
    public void setMatchScore(int score){
        this.matchScore.setText(Integer.toString(score));
    }
    
    public void setGameScore(int score){
        this.gameScore.setText(Integer.toString(score));
    }
    
    public String getName(){
        return this.name.getText();
    }
    
    public int getMatchScore(){
        return Integer.parseInt(this.matchScore.getText());
    }
    
    public int getGameScore(){
        return Integer.parseInt(this.gameScore.getText());
    }
    
    public static void main(String args[]){
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                JFrame prova = new JFrame();
                new JFrame().add(new PlayerGui()).setVisible(true);
            }
        });
        
    }
}
